package service.impl;

import dao.PetOwnerDao;
import dao.impl.PetOwnerDaoImpl;
import entity.Pet;
import entity.PetOwner;
import service.PetOwnerService;

import java.util.List;

public class PetOwnerServiceImpl implements PetOwnerService {
    private PetOwnerDao petOwnerDao=new PetOwnerDaoImpl();
    @Override
    public List<PetOwner> getPetOwnerList() throws Exception {
        List<PetOwner> petOwnerList = petOwnerDao.getPetOwnerList();
        return petOwnerList;
    }

    @Override
    public PetOwner login(PetOwner petOwner) throws Exception {
        int login = petOwnerDao.login(petOwner);
        if (login>0){
            System.out.println("··········恭喜您登入成功·······");
            System.out.println("··········您的基本信息：·········");
            System.out.println("姓名：\t"+petOwner.getName()+"\r\n元宝数：\t"+petOwner.getMoney());

        }else {
            System.out.println("登入失败！！！！");
        }
        return petOwner;
    }


}
